package com.amazon.operations;

import java.util.ArrayList;

/**
 *
 * @author Salman Noor, Shcool of Electrical and Information Engineering
 * @Copyright: Wits University 2013 - All Rights Reserved
 * @email salmannoor74415@gmail.com
 * @License BSD License (http://www.linfo.org/bsdlicense.html)
 */
public class min extends Operation {

    @Override
    public void setParameters(ArrayList<Integer> parameters) {
        super.parameters = parameters;
    }

    @Override
    public int findResult() {
        
        if (super.parameters.size() >0){
        int result =super.parameters.get(0);
        for(Integer i: super.parameters){
            if (i < result){
                result = i;
            }
        }
        return result;
        }else{
            return -1;
        }
    }

}
